import base64
import json
from datetime import datetime
import logging
from lapi_app.models.user_model.user_info import Userinfo

logger = logging.getLogger('django')


def access_token(user_id):
    try:
        # user = Userinfo.objects.get(id=eval(user_id))
        # token = json.loads(base64.b64decode(user.token.replace("b'", "'").replace("'", "")))
        # if (datetime.now() - user.token_time).days < 7 and user.token != '' and user.token != 0 and token["user_id"] == user.id:
        #     return True
        # else:
        #     return True
        return True
    except Exception as e:
        logger.info(str(e))
        return True
